﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DBLayer;
using System.Data;
using System.Data.SqlClient;

namespace BALayer
{
    public class DBLichGiangDay
    {
        DAL db = null;
        public DBLichGiangDay()
        {
            db = new DAL();
        }
        //Lay Lich Giang Day
        public DataSet LayLichGiangDay()
        {
            return db.ExecuteQueryDataSet("Select * From LichGiangDay", CommandType.Text, null);
        }
        //Them Lich Giang Day
        public bool ThemLichGiangDay(ref string err, string MaGV, string MaHocKy, string MaMH, string MaLop)
        {
            return db.MyExecuteNonQuery("SpThemLichGiangDay", CommandType.StoredProcedure, ref err,
                new SqlParameter("@MaGV", MaGV),
                new SqlParameter("@MaHocKy", MaHocKy),
                new SqlParameter("@MaMH", MaMH),
                new SqlParameter("@MaLop", MaLop));
        }
        //Xoa Lich Giang Day
        public bool XoaLichGiangDay(ref string err, string MaGV, string MaHocKy, string MaMH, string MaLop)
        {
            return db.MyExecuteNonQuery("SpXoaLichGiangDay", CommandType.StoredProcedure, ref err,
                new SqlParameter("@MaGV", MaGV),
                new SqlParameter("@MaHocKy", MaHocKy),
                new SqlParameter("@MaMH", MaMH),
                new SqlParameter("@MaLop", MaLop));
        }
        //Cap nhat Lich Giang Day
        public bool CapNhatLichGiangDay(ref string err, string MaGV, string MaHocKy, string MaMH, string MaLop)
        {
            return db.MyExecuteNonQuery("SpCapNhatLichGiangDay", CommandType.StoredProcedure, ref err,
                new SqlParameter("@MaGV", MaGV),
                new SqlParameter("@MaHocKy", MaHocKy),
                new SqlParameter("@MaMH", MaMH),
                new SqlParameter("@MaLop", MaLop));
        }
    }
}
